$(function() {
	
	$('#homeLoginSubmit').click(function() {
		if($("#homeLoginId").val()==""){
			$('#homeLoginMsg').html("請輸入帳號!");
			return false;
		}
		if($("#homePassword").val()==""){
			$('#homeLoginMsg').html("請輸入密碼!");
			return false;
		}
		if($("#homeLoginValiCode").val()==""){
			$('#message').html("請輸入認證碼!");
			return false;
		}
		var form = $('#homeLoginForm');
		form.attr('action', 'login!login.action');
		form.submit();
	});
	
	$('#homeResetValiCode').click(function() {
		var randomNum = Math.floor(Math.random()*(100-0));
		$('#homeValiImg').attr('src', 'validateCode!homeValidateCode.action??randomNum='+randomNum+'');
	});
});